# Teno UI组件
print('------')
from mpython import*
from Teno_Brain.dice import*
print('UI.py')

def items_(title='', item=[], choice=1, apicon='Null', tlicon='Null', tricon='Null', blicon='Null', bricon='Null'):
    fresh_(0)
    if apicon != 'Null':
        bip_(29, 7, apicon, 15, 15)
    if tlicon != 'Null':
        bip_(6, 6, tlicon, 15, 15)
    if tricon != 'Null':
        bip_(116, 6, tricon, 15, 15)
    if blicon != 'Null':
        bip_(6, 42, blicon, 15, 15)
    if bricon != 'Null':
        bip_(116, 42, bricon, 15, 15)
    text_(title, 46, 7, 1, False)
    for itm_num in len(item):
        rect_(6, roll_y + 25 + itm_num*3, 114, 40, 5)
        text_(item[itm_num+choice-1], 46, roll_y + 27 + itm_num*9)
    fresh_(1)

def articles_(title='', content='', apicon='Null', tlicon='Null', tricon='Null', blicon='Null', bricon='Null'):
    roll_y = 0
    fresh_(0)
    if apicon != 'Null':
        bip_(6, 6, apicon, 15, 15)
    if tlicon != 'Null':
        bip_(6, 6, tlicon, 15, 15)
    if tricon != 'Null':
        bip_(116, 6, tricon, 15, 15)
    if blicon != 'Null':
        bip_(6, 42, blicon, 15, 15)
    if bricon != 'Null':
        bip_(116, 42, bricon, 15, 15)
    text_(title, 46, 7, 1, False, 13)
    text_(content, 6, roll_y + 27, 1, False, 13)
    fresh_(1)